<?php
namespace App\Admin\Actions\Extensions;

use Dcat\Admin\Grid\Tools\AbstractTool;

class NavigaterUrlButton extends AbstractTool{
    protected $style = 'btn btn-primary';

    protected $route = '';
    protected $icon = '';
    protected $name = '';

    public function __construct($route, $icon, $name) {
        parent::__construct();
        $this->name = $name;
        $this->icon = $icon;
        $this->route = $route;
    }

    public function html()
    {
        return "<a href='".admin_url($this->route)."' target='_blank'><button class='btn btn-primary'><i class=\"".$this->icon."\"></i>&nbsp;".$this->name."</button></a>";
    }
}
